home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer Helper 1: Phil & Dave's Excellent CD
/
Excellent CD HFS.raw
/
Utilities
/
Apple File Exchange
/
AppleFile Exchange Translator
/
ExampleTrans
/
Example.r
< prev
next >
Wrap
Text File
|
1989-04-13
|
3KB
|
81 lines
/* Example Translation inclusion Resource Definition File */
/* */
/* written by Karl B. Young 7/16/87 */
/* include any static resources like dialogs, strings, etc. */
include "Example.rsrc";
/* include the code itself */
include ":Objects:Example.tmp" 'MCMC' (4000) as 'MCMC' (4000,"STR# Resources to Text…",PURGEABLE);
/* include the About text */
read 'TEXT' (4000) "Example.txt";
/* Create a STR# resource containing all the error strings our translator */
/* produces. The str_xxxxx are the constants used to reference each string */
/* in Example.p */
resource 'STR#' (4000) { {
/* str_error = 1; */ "An error occurred while ";
/* str_creating = 2; */ "creating the destination file: ";
/* str_opensrc = 3; */ "opening the source file: ";
/* str_opendst = 4; */ "opening the destination file: ";
/* str_getfinfo = 5; */ "getting information about the file: ";
/* str_setfinfo = 6; */ "setting the file type of the destination file: ";
/* str_reading = 7; */ "reading in the source file: ";
/* str_writing = 8; */ "writing out the destination file: ";
/* str_copying = 9; */ "Copying STR# resources…";
/* str_initing = 10; */ "initializing the translator '";
/* str_period = 11; */ "'.";
/* str_cant = 12; */ "It cannot translate from '";
/* str_to = 13; */ "' to '";
/* str_delsrc = 14; */ "deleting the original file (your translated data is in the file $$$AFE-TEMP$$$): ";
/* str_rendst = 15; */ "renaming the destination file (your translated data is in the file $$$AFE-TEMP$$$): ";
/* str_numstrings = 16; */ "Number of STR# resources in this file: ";
/* str_stringRes = 17; */ "String Resource Number "
} };
/* The following is used to create a different icon for the translator */
/* The new icon was created by using ResEdit to modify the standard */
/* translator icon. For more detail see Inside Mac III, pp.10-13 */
/* define the resource type? as a string type */
/* The file "Signature.r" is created by the make file ("Example.make") and contains */
/* the signature resource (in this case, of type 'exmp') necessary for displaying */
/* a different icon */
/* The text in the "exmp" resource will be diplayed when a Get Info is done on the */
/* translator in the Finder*/
#include ":objects:Signature.r"
/* The BNDL id number (0) is necessary but not important, it is never used */
resource 'BNDL' (0) {
'exmp',
0,
{
/* Map the local icon number 0 to the actual icon resource 128 */
/* we use ICN# instead of ICON so that the mask is included, the */
/* mask is how the icon looks highlighted */
'ICN#',
{
0, 128
},
/* Map local FREF 0 to FREF 128 */
'FREF',
{
0, 128
}
}
};
/* Create a file reference resource of id=128 that associates type VISA */
/* with the icon of local ID = 0 ; */
resource 'FREF' (128) {
'VISA',
0,
""
};
/* for this icon to be used with the translator the bundle bit */
/* must be set. This is done with the setfile -a B 'Example Tran' */
/* statement in MPW after building the translator with rez */